import 'package:dio/dio.dart';

import '../../data/local/local_storage.dart';

class TokenInterceptors extends InterceptorsWrapper {
  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    String? token =SharedPreferencesManager().getToken();

    if (token != null && token.isNotEmpty) {
      // options.headers['Authorization'] = "Bearer ${LocalStorage.getToken()}";
      options.headers['token'] = "${SharedPreferencesManager().getToken()}";
    }

    handler.next(options);
  }
}
